-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(alerts&reports): Alerts & Reports will use values from WEBDRIVER_WINDOW option #13157
Conversation
@iercan thank you for the fix, I restarted CI jobs. But you need to take care of: you can run locally:
|
@dpgaspar I executed the commands on my branch. What it is doing? |
@iercan it does a bunch of things, https://github.com/apache/superset/blob/master/.pre-commit-config.yaml Also take a look at: |
@dpgaspar so should I recommit and push my changes? or running pre-commit is just enough? |
@dpgaspar oh I got it. It reformatted files. I had to run as |
Codecov Report
@@ Coverage Diff @@
## master #13157 +/- ##
==========================================
+ Coverage 66.88% 67.30% +0.41%
==========================================
Files 1021 497 -524
Lines 50015 29410 -20605
Branches 4907 0 -4907
==========================================
- Hits 33455 19794 -13661
+ Misses 16435 9616 -6819
+ Partials 125 0 -125
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
superset/config.py
Outdated
@@ -946,7 +946,7 @@ class CeleryConfig: # pylint: disable=too-few-public-methods | |||
WEBDRIVER_TYPE = "firefox" | |||
|
|||
# Window size - this will impact the rendering of the data | |||
WEBDRIVER_WINDOW = {"dashboard": (1600, 2000), "slice": (3000, 1200)} | |||
WEBDRIVER_WINDOW = {"dashboard": (1600, 3000), "slice": (1280, 960)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably a breaking change, why do we need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dpgaspar For the record. There will be no problem with reports because I provided same thumb_size and window_size for reports. But they still get so blur for thumbnails. I can revert this change if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to revert that and provide old harcoded sizes for thumbnails so that caches will not be needed to recalculated again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, better to change your PR description: Additional note: This PR will cause thumbnails recalculate because cache keys depends on window size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed that part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iercan, Although this is a bug, and this PR fixes it, it's also a breaking change. Starting to see the necessity to create 2 new config keys, one for thumbnails
and another for reports
, so that it's possible to configure both independently
Sure I can add 2 different options. But with final edit I made, I don't think it is a breaking change anymore. I kept thumbnails untouched and just reports will use webdriver window. Isn't WEBDRIVER_WINDOW meant to be used just for reports? |
it is, it's sort of a breaking change because the new reports will now change its image size. I think it would be more flexible to have the 2 new config keys. Let the new reports still take the screenshot with the previous size, but making it now possible for everyone to configure it thoughts? |
I think adding 2 different config may get configuration more complicated from point of view of a user. Also I'm not sure thumbnail size should be configurable. |
Good point, but still seems weird to me that by configuring |
…WINDOW option (apache#13157) * fix: thumbnails and reports will be use WEBDRIVER_WINDOW option * changes reformatted * config change reverted. thumbnails sizes changed to original * typo fix * bugfix defining defaults in thumbnails.py caused thumbnail caches invalidated. they moved to init. Co-authored-by: Ibrahim Ercan <ibrahim.ercan@vlmedia.com.tr>
…WINDOW option (apache#13157) * fix: thumbnails and reports will be use WEBDRIVER_WINDOW option * changes reformatted * config change reverted. thumbnails sizes changed to original * typo fix * bugfix defining defaults in thumbnails.py caused thumbnail caches invalidated. they moved to init. Co-authored-by: Ibrahim Ercan <ibrahim.ercan@vlmedia.com.tr>
SUMMARY
This PR resolves #13097
This improvement make thumbnails and new reports module uses WEBDRIVER_WINDOW option from config.
I defined init function to screenshot object to pass window_size and thumb_size same value for reports so that images will not be shrink . Before It was using harcoded 800x600 value which is defined for thumbnails.
TEST PLAN
Create alert and reports. Images should be sent same size defined with WEBDRIVER_WINDOW
ADDITIONAL INFORMATION